package com.dstation.service;

import com.dstation.dao.FollowTableInfoMapper;
import com.dstation.domain.FollowTableInfo;
import com.dstation.domain.UserInfo;
import com.dstation.domain.VideoInfo;
import com.dstation.service.interf.IFollowTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;

@Service
public class FollowTableServiceImpl  implements IFollowTableService {
    @Autowired
    private FollowTableInfoMapper followTableInfoMapper;

    @Override
    public List<FollowTableInfo> findMyFollowUserByUserId(Long userId) {
        return followTableInfoMapper.selectMyFollowUserByUserId(userId);
    }

    @Override
    public List<VideoInfo> findFollowVideo(UserInfo userInfo) {
        //是否登录
        if(Objects.isNull(userInfo)){
            return null;
        }
        List<VideoInfo> res=followTableInfoMapper.selectFollowVideo(userInfo.getUserId());

        return res;
    }
}
